<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="fragments/head :: head(~{:: title})">
    <title>表详情</title>
    <link rel="stylesheet" href="../../static/css/bootstrap.min.css"/>
</head>
<body>
<nav th:replace="fragments/navbar :: navbar">navbar</nav>
<div class="container">
    <div th:insert="fragments/alert :: alert">alert</div>
    <h3 class="text-center" th:text="${eppdevTable.tableName + ' 表详情'}">表详情</h3>
    <hr/>
    <div class="row">
        <div class="col-sm-4">
            <div class="col-sm-12">
                <p>所属版本：
                    <a th:href="@{'/version/' + ${eppdevTable.versionId} }">
                        <small th:text="${eppdevTable.version.versionName}"></small></a>
                </p>
            </div>
            <div class="col-sm-12">
                <p>所属模块：
                    <small th:text="${eppdevTable.moduleName}"></small>
                </p>
            </div>
        </div>
        <div class="col-sm-4">
            <div class="col-sm-12">
                <p>表说明：
                    <small th:text="${eppdevTable.tableComment}"></small>
                </p>
            </div>
            <div class="col-sm-12">
                <p>实体名称：
                    <small th:text="${eppdevTable.entityName}"></small>
                </p>
            </div>
        </div>
        <div class="col-sm-4">
            <div class="col-sm-12">
                <p>创建时间：
                    <small th:text="${#dates.format(eppdevTable.createDate, 'yyyy-MM-dd HH:mm:ss')}"></small>
                </p>
            </div>
            <div class="col-sm-12">
                <p>修改时间：
                    <small th:text="${#dates.format(eppdevTable.updateDate, 'yyyy-MM-dd HH:mm:ss')}"></small>
                </p>
            </div>
        </div>
        <div class="col-sm-12">
            <div class="col-sm-12">
                <p>备注：
                    <small th:text="${eppdevTable.remarks}"></small>
                </p>
            </div>
        </div>
    </div>
    <hr/>
    <div class="row panel panel-default">
        <div class="panel-heading">字段列表</div>
        <div class="panel-body">
            <div class="text-right">
                <a th:href="@{'/table/' + ${eppdevTable.id} +'/column/add/to'}">添加</a>
            </div>
            <table class="table table-bordered">
                <thead>
                <tr>
                    <td width="10%" class="text-center">序号</td>
                    <td width="15%" class="text-center">列名</td>
                    <td width="10%" class="text-center">类型</td>
                    <td width="10%" class="text-center">长度</td>
                    <td width="15%" class="text-center">属性名称</td>
                    <td width="15%" class="text-center">Java类</td>
                    <td width="15%" class="text-center">说明</td>
                    <td width="10%" class="text-center">操作</td>
                </tr>
                </thead>
                <tbody>
                <tr th:each="column,iterStat : ${eppdevTable.columnList}">
                    <td th:text="${iterStat.count}" class="text-center">1</td>
                    <td th:text="${column.columnName}"></td>
                    <td th:text="${column.columnType}"></td>
                    <td th:text="${column.columnLength}"></td>
                    <td th:text="${column.propertyName}"></td>
                    <td th:text="${column.javaType}"></td>
                    <td th:text="${column.columnComment}"></td>
                    <td class="text-center">
                        <a th:href="@{'/table/' + ${column.tableId} + '/column/update/' + ${column.id} + '/to'}">修改</a>
                        &nbsp;
                        <a th:href="@{'/table/' + ${column.tableId} + '/column/' + ${column.id} + '/delete'}">删除</a>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
    <hr/>
    <div class="row panel panel-default">
        <div class="panel-heading">索引列表</div>
        <div class="panel-body">
            <div class="text-right">
                <a th:href="@{'/table/' + ${eppdevTable.id} +'/index/add/to'}">添加</a>
            </div>
            <table class="table table-bordered">
                <thead>
                <tr>
                    <td class="text-center" width="7%">序号</td>
                    <td class="text-center" width="45%">索引名</td>
                    <td class="text-center" width="40">索引字段</td>
                    <td class="text-center" width="8%">操作</td>
                </tr>
                </thead>
                <tbody>
                <tr th:each="idx,iterStat : ${eppdevTable.indexList}">
                    <td th:text="${iterStat.count}" class="text-center"></td>
                    <td th:text="${idx.indexName}"></td>
                    <td th:text="${idx.columnNames}"></td>
                    <td class="text-center">
                        <a th:href="@{'/table/update/' + ${eppdevTable.id} + '/index/delete/' + ${idx.id}}">删除</a>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>

    <div class="row">

    </div>
    <div th:replace="fragments/footer :: copy"></div>
</div>

</body>
</html>